package top.fyr.controller;

import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.fyr.model.User;
import top.fyr.service.UserService;

import java.util.List;

/**
 * @Description
 * @Author 付阳荣
 * @CreateDate 2018/3/5
 */
@RestController
public class UserController {

    @Autowired
    private UserService userService;


    @RequestMapping("/listUsers")
    public List<User> listUsers(int pageNum, int pageSize) {
        //用PageInfo对结果进行包装
        return userService.listUsers(new User(), new RowBounds(pageNum,pageSize));
    }

    @RequestMapping("/listAllUsers")
    public List<User> listAllUsers() {
        //用PageInfo对结果进行包装
        return userService.listAllUsers();
    }


}
